package com.bjboot.caocao;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;

//项目入口
@SpringBootApplication
@EnableTransactionManagement
@ServletComponentScan
@MapperScan("com.bjboot.caocao.*.dao")
public class CaocaoApplication extends SpringBootServletInitializer {

    // 打war包使用
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(CaocaoApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(CaocaoApplication.class, args);
        Logger logger = LoggerFactory.getLogger(CaocaoApplication.class);
        logger.info("ヾ(◍°∇°◍)ﾉﾞ    BJ-boot系统启动成功      ヾ(◍°∇°◍)ﾉﾞ\n" +
                " ______           _     ______                    _\n" +
                "|_   _ \\         | |    |_   _ \\                  / |_\n" +
                "  | |_) |        | |      | |_) |   .--.    .--. `| |-\n" +
                "  |  __'.    _   | |      |  __'. / .'`\\ \\/ .'`\\ \\| | \n" +
                " _| |__) |  \\ \\__| |     _| |__) || \\__. || \\__. || |,\n" +
                "|_______/    '.___.'    |_______/  '.__.'  '.__.' \\__/");
    }
}
